package com.gitee.xmhzzz.mars.code.mqtt.broker.domain;

import java.util.Date;
import java.util.List;

/**
 * @ClassName MqttClient
 * @Description TODO
 * @Author wzq
 * @Date 2024/9/29 15:45
 * @Version 1.0
 */

public class MqttClient {
    private String username;
    private String clientId;
    private List<String> subscriptions;
    private Date connectTime;
    private String ipAddress;
    private Date disconnectTime;

    // 构造方法
    public MqttClient(String username, String clientId, List<String> subscriptions, String ipAddress) {
        this.username = username;
        this.clientId = clientId;
        this.subscriptions = subscriptions;
        this.connectTime = new Date();
        this.ipAddress = ipAddress;
    }

    // Getters and Setters for the fields

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public List<String> getSubscriptions() {
        return subscriptions;
    }

    public void setSubscriptions(List<String> subscriptions) {
        this.subscriptions = subscriptions;
    }

    public Date getConnectTime() {
        return connectTime;
    }

    public void setConnectTime(Date connectTime) {
        this.connectTime = connectTime;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public Date getDisconnectTime() {
        return disconnectTime;
    }

    public void setDisconnectTime(Date disconnectTime) {
        this.disconnectTime = disconnectTime;
    }
}

